<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<p:dialog id="dialogCadastro" modal="true" width="50%" position="true"
	appendTo="@(body)" closable="false" resizable="true" draggable="true"
	widgetVar="dialogCadastroExame" header="Cadastro de Exame">
	<p:ajax event="close" listener="#{exameMB.close}"
		update="frmDialogExame" />
	<h:form id="frmDialogExame">

		<h:panelGrid columns="2">

			<p:outputLabel value="Codigo:"></p:outputLabel>
			<p:inputText value="#{exameMB.exameSelecionado.codigo}"
				disabled="true"></p:inputText>

			<p:outputLabel value="Descrição:"></p:outputLabel>
			<p:inputText id="iptnome" onfocus="iptdescricao"
				value="#{exameMB.exameSelecionado.descricao}" size="30"
				disabled="#{exameMB.consultando}" required="true"
				requiredMessage="Descrição é obrigatória!" maxlength="40"></p:inputText>

			<p:outputLabel value="Tipo Exame:"></p:outputLabel>
			<p:selectOneMenu value="#{exameMB.exameSelecionado.tipoExame}"
				required="true" id="selecttipo" filter="true" disabled="#{exameMB.consultando}"
				converter="tipoExameConverter">
				<f:selectItems value="#{exameMB.listaTipoExame}" var="tipoExame"
					itemLabel="#{tipoExame.descricao}" itemValue="#{tipoExame}"></f:selectItems>
			</p:selectOneMenu>
			
					<p:outputLabel value="Preço:"></p:outputLabel>
			<p:inputText id="iptpreco" onfocus="iptpreco"
				value="#{exameMB.exameSelecionado.precoCobrado}" size="15"
				onkeypress="return(mascaras(this,moeda))" converter="doubleConverter"
				disabled="#{exameMB.consultando}" required="true"
				requiredMessage="Preço é obrigatório!"></p:inputText>

			<p:outputLabel value="Preparo:"></p:outputLabel>

			<p:inputTextarea id="iptpreparo" onfocus="iptpreparo"
				value="#{exameMB.exameSelecionado.preparo}"
				disabled="#{exameMB.consultando}" required="true"
				requiredMessage="Preparo é obrigatório!" maxlength="100"></p:inputTextarea>




		</h:panelGrid>
		<h:panelGrid columns="2" style="border:0px">
			<p:commandButton value="Confirma" actionListener="#{exameMB.salvar}"
				rendered="#{not exameMB.consultando}"
				update=":frmTab:tabela,:mensagem"
				oncomplete="validaDialog(args,'dialogCadastroExame','frmDialogExame:dialogCadastro')" />


			<p:commandButton value="Cancela" onclick="dialogCadastroExame.hide()"
				immediate="true" />

		</h:panelGrid>

	</h:form>
</p:dialog>

</html>